(defun criba (n)
	(let ((tabla (make-array n))
			(i 2)
			aux)
		(setf (aref tabla 0) 'no-primo
		(aref tabla 1) 'no-primo)
		(loop while (< i n) do
			(setf aux (+ i i))
			(loop while (< aux n) do
				(setf (aref tabla aux) 'no-primo)
				(setf aux (+ i aux)))
			(setf i (1+ i))
			(loop while (and (< i n) (aref tabla i)) do
					(setf i (1+ i))))
	(resumen tabla n)))

(defun resumen (tabla n)
	(loop for i from 0 to (1- n)
	when (null (aref tabla i))
	summing i))

(time (print (criba 1000000)))